home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung / Power-Programmierung (Tewi)(1994).iso / magazine / c_news / 16 / sets / setsourc / setncldd.c < prev    next >
C/C++ Source or Header  |  1989-03-09  |  870b  |  30 lines

  1. #include <stdio.h>
  2. #include <stdarg.h>
  3. #include "sets.h"
  4. /***************************************************************************/
  5.      boolean set_included_in(set *left, set *right)
  6. /***************************************************************************/
  7. /* The left set is included in the right set if every member of left is a
  8.    member of right.   left <= right
  9. */
  10. {
  11. defset(temp,UNIVERSAL,MAX_MEMBERS,0);
  12.  
  13.     /* check base_types.  By definition, this comparison is false unless
  14.        we are comparing the same base_type sets.
  15.     */
  16.     if(!cmp_base_types(left,right) || !cmp_set_tags(left,right))
  17.         return FALSE;
  18.  
  19.     /* If the set_difference, left - right, is an empty set, then this
  20.        function is TRUE.
  21.     */
  22.     set_difference(&temp, left, right);
  23.     if(temp.nmembers == 0)
  24.         return TRUE;
  25.     else
  26.         return FALSE;
  27.  
  28. }  /* end set_included_in */
  29.  
  30.